#ifndef __BASERENDERER__
#define __BASERENDERER__

#include "shared.h"
struct OverlayState;

class BaseRenderer
{
protected:
  class BaseTexture
  {
  public:
    virtual ~BaseTexture() {}
  };
private:
  BaseTexture* tFrame;
  BaseTexture* tReply;
  BaseTexture* tScroll;
  BaseTexture** tImages;
  int numImages;
  bool getTexture(BaseTexture** tex, ImageHeader* image);
protected:
  OverlayState const* state;

  virtual BaseTexture* newTexture() = 0;
  virtual bool updateTexture(BaseTexture* tex, ImageHeader* image) = 0;
  virtual void drawRect(BaseTexture* tex, int left, int top, int right, int bottom,
    unsigned long color = 0xFFFFFFFF) = 0;
  virtual void setViewport(int left, int top, int right, int bottom) = 0;

  virtual void render();
  virtual void reset();

  BaseRenderer(OverlayState const* pState);
  ~BaseRenderer();
};

#endif // __BASERENDERER__
